﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Downplay.Mechanics.Framework;

namespace Downplay.Theory.Economics.Events
{
    public class MenuSocketEvents : SocketHandler
    {
        public MenuSocketEvents() { }
        protected override void Filtering(SocketEventContext context)
        {
        }

        protected override void Displaying(SocketDisplayContext context)
        {
            if (context.Left.DisplayType == "CategoryMenu")
            {
                // Render proper menu links
                if (context.Connector.Name == "SiteToCategory" || context.Connector.Name == "CategoryToChildCategory")
                {
                    context.Connector.DisplayType = "CategoryMenuSub";
                }
            }
            if (context.Left.DisplayType == "CategoryMenuSub")
            {
                if (context.Connector.Name == "CategoryToChildCategory")
                {
                    context.Connector.DisplayType = "CategoryMenuSub";
                }
            }

        }
        
    }
}